package com.hexus.eve.actions.security;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;


import com.hexus.eve.entities.security.SecurityGroup;
import com.opensymphony.xwork2.ActionSupport;

public class Groups extends ActionSupport {
	private static final long serialVersionUID = 1L;

	@Autowired
	private SessionFactory sessionFactory;
	
	private List<SecurityGroup> securityGroups;
	
	@Override
	public String execute() throws Exception {
		HibernateTemplate ht = new HibernateTemplate(sessionFactory);
		securityGroups = ht.loadAll(SecurityGroup.class);
		return SUCCESS;
	}

	
	public List<SecurityGroup> getSecurityGroups() {
		return securityGroups;
	}

	public void setSecurityGroups(List<SecurityGroup> securityGroups) {
		this.securityGroups = securityGroups;
	}
	
}
